#pragma once

#include <string>
#include <set>
#include <unordered_map>
#include <fstream>
#include "Const.h"
#include "MapFunc.h"
#include "IdRegister.h"

using namespace std;


class IdManager {
    private:
        static IdManager* idManager;
        unordered_map<string,IdRegister*> registerCenter;
        IdManager();
        ~IdManager();
        
    public:
        static void initIdManager();
        static IdManager* getIdManager();
        static void deteleIdManager();
        bool isRegistered(const string &name);
        bool isIdExist(const string &name,const string &id);
        bool registered(const string &name,const string &front,const int length);
        string createId(const string &name);
        bool addId(const string &name,const string &id);
        bool removeId(const string &name,const string &id);
        bool saveData();
        bool loadData();
};